import Layout from '@/layout'
import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import TableButtonType from "@/framework/constant/TableButtonType";

export default [
  {
    path: '/mgr',
    component: Layout,
    meta: {title: '账号管理', icon: 'el-icon-s-help'},
    children: [
      {
        path: 'admin',
        component: () => import('@/feature/mgr/app/admin/index'),
        meta: {title: '账号管理', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('mgr:admin', '账号').curdNoBatch()
          .addButtons([
            {handler: 'online', type: TableButtonType.ROW, label: '启用', name: 'online'},
            {handler: 'resetPassword', type: TableButtonType.ROW, label: '重置密码', name: 'resetPassword'},
            {handler: 'offline', type: TableButtonType.ROW, label: '禁用', buttonType: 'danger', name: 'offline'}
          ])
          .build()
      },
      {
        path: 'role',
        component: () => import('@/feature/mgr/app/role/index'),
        meta: {title: '角色管理', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('mgr:role', '角色').curdNoBatch().addButton({
          handler: 'power',
          name: 'power',
          label: '权限'
        })
          .build()
      }
      // #appendSpot# 生成工具用，不要删了
    ]
  }
]
